package tpo.dao;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import pojo.BuyOrder;
import pojo.Journal;
import pojo.Pay_order;
import pojo.Receipt_order;
import pojo.finance.Day;
import pojo.finance.Fukuandan;
import pojo.finance.Kehuduizhang;
import pojo.finance.Zijinduizhang;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Component
public interface Receipt_order_Mapper {

    /**用于查询全部收款单*/
    List<Receipt_order> allreceipt_order(@RequestBody Map<String,Object> map);
    //用于测试
    List<Receipt_order> allReceipt_order();
    //查询某一收款单
    Receipt_order selectReceipt_order(@RequestParam(value = "code") String code);

    /**查询订单的对应的全部收款单位待收款状态的收款单总金额*/
    BigDecimal selectallReceipt_ordermoney(@RequestParam(value = "code") String code);

    /**管理员添加收款单*/
    Integer addReceipt_order(@RequestBody Receipt_order receipt_order);

    /**收款单作废操作*/
    Integer zuofei(@RequestBody Map<String,Object> map);

    /**收款单审核操作*/
    Integer shenhe(@RequestBody Map<String,Object> map);

    /**收支流水单分页查询*/
    List<Journal> alljournal(@RequestBody Map<String,Object> map);

    /**用于查询全部付款单*/
    List<Fukuandan> allPay_order(@RequestBody Map<String,Object> map);

    /**用于添加付款单*/
    Integer addPay_order(@RequestBody Pay_order pay_order);

    /**用于付款单作废操作*/
    Integer fukuanzuofei(@RequestBody Map<String,Object> map);

    /**根据某一付款单的code查询某一付款单信息*/
    Fukuandan selectpay_order(@RequestParam(value = "code") String code);

    /**用于付款审核*/
    Integer fukuanshenhe(@RequestBody Map<String,Object>map);

    /**用于客户对账的客户查询及其金额计算*/
    List<Kehuduizhang> selectusermoney(@RequestBody Map<String,Object> map);

    /**用于客户对账页面的总计*/
    Kehuduizhang selectusersum();

    /**用于客户对账详情页面的总计*/
    Kehuduizhang selectoneusersum(@RequestParam(value = "id") String id);

    /**用于客户对账详情页面的用户所属单据显示*/
    List<BuyOrder> selectoneuseralldan(@RequestBody Map<String,Object> map);

    /**用于资金账户页面的某个时间段的收支帐*/
    List<Zijinduizhang> selectdangtianzhang();

    /**用于资金账户明细*/
    List<Journal> selectzijinmingxi(@RequestBody Map<String,Object> map);

    /**用于收支流水生成*/
    Integer insertlsdan(@RequestBody Map<String, Object> map);

    /**用于付款单审核通过后，收支流水单的生成*/
    Integer insertfukuanlsdan(@RequestBody Map<String,Object> map);

    /**用于已完成收款单作废时，同时作废收支流水中的单据*/
    Integer updatesouzisoukuandan(String code);

    /**用于资金账户的7天内资金收支记录折线图*/
    List<Day> zijinzhexiantu();

    /**根据code查询某一订单的所有收款单 */
    List<Receipt_order> codeselectallreceipt(@RequestParam(value = "code") String code);

    /**根据code查询某一订单的所有付款单 */
    List<Pay_order> codeselectallfukuandan(@RequestParam(value = "code") String code);

    /**用于查询状态为已完成状态的付款单*/
    BigDecimal selectallokfukuandan(@RequestParam(value = "code")String code);

    /**用于在审核收款单后，进行账户总金额添加*/
    Integer addmoney(Map<String,Object> map);

    /**用于在作废状态为已完成收款单后，进行账户总金额减少*/
    Integer jianmoney(Map<String,Object> map);

    /**修改付款单上传凭证*/
    Integer upPay_order(@RequestBody Map<String,Object> map);


}
